﻿<inter:PluginConfigForm x:Class="Convertor.Plugin.SaveToDisk.ConfigForm"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:inter="clr-namespace:Convertor.Interface;assembly=Convertor.Interface"
             xmlns:sm="clr-namespace:Wpf.CommonTools.SystemExtension;assembly=Wpf.CommonTools"
             mc:Ignorable="d" 
             Loaded="UserControl_Loaded_1">
    <inter:PluginConfigForm.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Convertor;component\Assets\Style.xaml"/>
                <ResourceDictionary Source="/Convertor;component\Assets\Lang\StringResource.en.xaml"/>
                <ResourceDictionary Source="Assets\Lang\StringResource.zh.xaml"/>
                <ResourceDictionary Source="Assets\Lang\StringResource.en.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </inter:PluginConfigForm.Resources>
    <DockPanel LastChildFill="False" MinWidth="400" DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type inter:PluginConfigForm}}, Path=Config}">
        <AdornerDecorator DockPanel.Dock="Top">
            <ComboBox x:Name="cbEncodings" SelectedItem="{Binding Path=FileEncoding}">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Path=EncodingName}"></TextBlock>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
                <sm:WatermarkService.Titlemark>
                    <TextBlock Text="{DynamicResource Plugin_SaveToDisk_TextCode}" TextAlignment="Right"/>
                </sm:WatermarkService.Titlemark>
            </ComboBox>
        </AdornerDecorator>
        <DockPanel DockPanel.Dock="Top">
            <TextBlock x:Name="tbFilePath" Padding="7"
                           Text="{Binding Path=SaveFilePath, Mode=TwoWay}"/>
            <Button Content="{DynamicResource Clear}" Click="Button_Clear_Click"  HorizontalAlignment="Right" DockPanel.Dock="Right"/>
            <Button Content="{DynamicResource Plugin_SaveToDisk_SelectDirectory}" Click="Button_Select_Click"  HorizontalAlignment="Right" DockPanel.Dock="Right"/>
        </DockPanel>
        <TextBlock Style="{StaticResource InfoStyle}" DockPanel.Dock="Top" Text="{Binding Path=ToolTip}"/>
    </DockPanel>
</inter:PluginConfigForm>
